import 'pro_obj_infos_model.dart';

class ProEnterpriseModel {
  String? id;
  String? enterpriseName;
  String? enterpriseAlias;
  String? enterpriseIntroduction;
  String? enterpriseType;
  String? enterpriseProvice;
  String? enterpriseCity;
  String? enterpriseDemands;
  String? linkPerson;
  String? linkPhone;
  List<ProObjInfosModel>? objInfos;

  ProEnterpriseModel({
    this.id,
    this.enterpriseName,
    this.enterpriseAlias,
    this.enterpriseIntroduction,
    this.enterpriseType,
    this.enterpriseProvice,
    this.enterpriseCity,
    this.enterpriseDemands,
    this.linkPerson,
    this.linkPhone,
    this.objInfos,
  });

  factory ProEnterpriseModel.fromJson(Map<String, dynamic> json) {
    List? objInfos = json['objInfos'] as List?;
    var obj = objInfos?.map((e) => ProObjInfosModel.fromJson(e)).toList();
    return ProEnterpriseModel(
      id: json['id'] as String?,
      enterpriseName: json['enterpriseName'] as String?,
      enterpriseAlias: json['enterpriseAlias'] as String?,
      enterpriseIntroduction: json['enterpriseIntroduction'] as String?,
      enterpriseType: json['enterpriseType'] as String?,
      enterpriseProvice: json['enterpriseProvice'] as String?,
      enterpriseCity: json['enterpriseCity'] as String?,
      enterpriseDemands: json['enterpriseDemands'] as String?,
      linkPerson: json['linkPerson'] as String?,
      linkPhone: json['linkPhone'] as String?,
      objInfos: obj,
    );
  }

  Map<String, dynamic> toJson() => {
        'id': id,
        'enterpriseName': enterpriseName,
        'enterpriseAlias': enterpriseAlias,
        'enterpriseIntroduction': enterpriseIntroduction,
        'enterpriseType': enterpriseType,
        'enterpriseProvice': enterpriseProvice,
        'enterpriseCity': enterpriseCity,
        'enterpriseDemands': enterpriseDemands,
        'linkPerson': linkPerson,
        'linkPhone': linkPhone,
        'objInfos': objInfos,
      };
}
